<!DOCTYPE html>

<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">


<h:head>

	<style type="text/css">
.content {
	position: relative;
	width: 100%;
	margin: 0 auto;
}

.ui-layout,.ui-layout-doc,.ui-layout-unit,.ui-layout-wrap,.ui-layout-bd,.ui-layout-hd
	{
	border: none;
}

.companyHeaderGrid tr,.companyHeaderGrid td {
	border: none;
}

.delete-btn,.ui-widget-content .delete-btn {
	-moz-box-shadow: inset 0px 1px 0px 0px #f5978e;
	-webkit-box-shadow: inset 0px 1px 0px 0px #f5978e;
	box-shadow: inset 0px 1px 0px 0px #f5978e;
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f24537
		), color-stop(1, #c62d1f));
	background: -moz-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: -webkit-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: -o-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: -ms-linear-gradient(top, #f24537 5%, #c62d1f 100%);
	background: linear-gradient(to bottom, #f24537 5%, #c62d1f 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f24537',
		endColorstr='#c62d1f', GradientType=0);
	background-color: #f24537;
	-moz-border-radius: 6px;
	-webkit-border-radius: 6px;
	border-radius: 6px;
	border: 1px solid #d02718;
	display: inline-block;
	cursor: pointer;
	color: #ffffff;
	font-family: arial;
	font-size: 15px;
	font-weight: bold;
	text-decoration: none;
	text-shadow: 0px 1px 0px #810e05;
}

.delete-btn:hover {
	background: -webkit-gradient(linear, left top, left bottom, color-stop(0.05, #c62d1f
		), color-stop(1, #f24537));
	background: -moz-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: -webkit-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: -o-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: -ms-linear-gradient(top, #c62d1f 5%, #f24537 100%);
	background: linear-gradient(to bottom, #c62d1f 5%, #f24537 100%);
	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#c62d1f',
		endColorstr='#f24537', GradientType=0);
	background-color: #c62d1f;
}

.delete-btn:active {
	position: relative;
	top: 1px;
}
</style>

</h:head>

<h:body>
	<img class="content" src="#{resource['images/top.jpg']}" alt="immagine top"></img>

	<!-- Importo il css per la customizzazione della pagina -->
	<h:outputStylesheet name="/css/custom.css" />


	<p:growl id="growl" for="growl-message" showDetail="true" sticky="true" />

	<p:layout fullPage="false" style=" min-width: 90%; height: 1000px">

		<p:layoutUnit position="north"
			style="min-height:100px; font-size: 13pt">
			<p:toolbar>
				<p:toolbarGroup align="right">
					<h:form>
						<p:commandButton id="logoutButton" value="Logout"
							icon="ui-icon-play" action="#{logoutBean.logout()}" />
					</h:form>
				</p:toolbarGroup>
			</p:toolbar>
		</p:layoutUnit>


		<!-- START - ZONA SX DELLA PAGINA -->
		<p:layoutUnit position="west" collapsible="true" size="22%" gutter="0">

			<!-- Inserisco dal file left_menu (della cartella corrente) il menu con i comandi -->
			<ui:insert name="left-menu">
				<div style="padding: 0px 0px 0px 0px">
					<ui:include src="left_menu.xhtml" />
				</div>
			</ui:insert>

		</p:layoutUnit>
		<!-- STOP - ZONA SX DELLA PAGINA -->

		<!-- START - Dettagli del pacchetto -->
		<p:layoutUnit position="center"
			style="padding-left: 10px;margin-bottom: 0px" size="100%">

			<p:panelGrid columns="2" id="trasporto-detail-panel"
				styleClass="companyHeaderGrid" style="min-width: 100%;">

				<f:facet name="header">
					<p:outputLabel style="font-size: 13pt">Dettagli del trasporto selezionato: </p:outputLabel>

					<h:form>
						<p:commandButton value="Elimina Trasporto" type="button"
								styleClass="delete-btn" onclick="PF('delete_dialog').show()" />
						<p:commandButton value="Modifica Trasporto" icon="ui-icon-pencil"
							action="edit_trasporto" ajax="false" />
					</h:form>
					
						<!-- Dialog di eliminazione -->					
					<h:form id="del_dialog">
					
						<p:growl  for="delete_trasporto_growl" autoUpdate="true" life="2000"
						showDetail="true"/>
						<p:dialog header="Confermi l'eliminazione del trasporto corrente?"
							widgetVar="delete_dialog" resizable="false" position="center"
							height="60px" width="300px">
							<h:form id="delete_form">
								<p:commandButton value="Si" styleClass="delete-btn"
									oncomplete="PF('delete_dialog').hide();" update=":del_dialog"
									action="#{trasportoBean.deleteTrasporto}" />
								<p:commandButton value="No" style="width: 70px; height: 35px"
									oncomplete="PF('delete_dialog').hide();" />

							</h:form>
						</p:dialog>
					</h:form>
						<!-- FINE - Dialog di eliminazione -->
					
				</f:facet>

				<h:outputText value="Citta di Partenza: " />
				<p:outputLabel
					value="#{trasportoBean.trasportoSelezionato.cittaPartenza.name}" />

				<h:outputText value="Citta di Partenza: " />
				<p:outputLabel
					value="#{trasportoBean.trasportoSelezionato.cittaArrivo.name}" />

				<h:outputText value="Data: " />
				<p:outputLabel
					value="#{trasportoBean.trasportoSelezionato.dataAsString}" />

				<h:outputText value="Prezzo: " />
				<p:outputLabel value="#{trasportoBean.trasportoSelezionato.prezzo}" />

				<h:outputText value="Numero Posti: " />
				<p:outputLabel
					value="#{trasportoBean.trasportoSelezionato.disponibilita}" />

			</p:panelGrid>

		</p:layoutUnit>
		<!-- STOP - Dettagli del pacchetto -->

	</p:layout>

	<img class="content" src="#{resource['images/bottom.jpg']}" alt="immagine top"></img>

</h:body>
</html>